/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.streamerstudio.model.gstreamer.registry.impl;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import org.streamerstudio.model.gstreamer.GstreamerPackage;

import org.streamerstudio.model.gstreamer.impl.GstreamerPackageImpl;

import org.streamerstudio.model.gstreamer.registry.GstElement;
import org.streamerstudio.model.gstreamer.registry.GstObject;
import org.streamerstudio.model.gstreamer.registry.GstPlugin;
import org.streamerstudio.model.gstreamer.registry.GstRegistry;
import org.streamerstudio.model.gstreamer.registry.RegistryFactory;
import org.streamerstudio.model.gstreamer.registry.RegistryPackage;

import org.streamerstudio.model.gstreamer.target.TargetPackage;

import org.streamerstudio.model.gstreamer.target.impl.TargetPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class RegistryPackageImpl extends EPackageImpl implements RegistryPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass gstRegistryEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass gstPluginEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass gstElementEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass gstObjectEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see org.streamerstudio.model.gstreamer.registry.RegistryPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private RegistryPackageImpl() {
		super(eNS_URI, RegistryFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link RegistryPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static RegistryPackage init() {
		if (isInited) return (RegistryPackage)EPackage.Registry.INSTANCE.getEPackage(RegistryPackage.eNS_URI);

		// Obtain or create and register package
		RegistryPackageImpl theRegistryPackage = (RegistryPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof RegistryPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new RegistryPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		GstreamerPackageImpl theGstreamerPackage = (GstreamerPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(GstreamerPackage.eNS_URI) instanceof GstreamerPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(GstreamerPackage.eNS_URI) : GstreamerPackage.eINSTANCE);
		TargetPackageImpl theTargetPackage = (TargetPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(TargetPackage.eNS_URI) instanceof TargetPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(TargetPackage.eNS_URI) : TargetPackage.eINSTANCE);

		// Create package meta-data objects
		theRegistryPackage.createPackageContents();
		theGstreamerPackage.createPackageContents();
		theTargetPackage.createPackageContents();

		// Initialize created meta-data
		theRegistryPackage.initializePackageContents();
		theGstreamerPackage.initializePackageContents();
		theTargetPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theRegistryPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(RegistryPackage.eNS_URI, theRegistryPackage);
		return theRegistryPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getGstRegistry() {
		return gstRegistryEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getGstRegistry_Plugins() {
		return (EReference)gstRegistryEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getGstRegistry_Target() {
		return (EReference)gstRegistryEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getGstPlugin() {
		return gstPluginEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getGstPlugin_Elements() {
		return (EReference)gstPluginEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstPlugin_Filename() {
		return (EAttribute)gstPluginEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstPlugin_Version() {
		return (EAttribute)gstPluginEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstPlugin_License() {
		return (EAttribute)gstPluginEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstPlugin_Source() {
		return (EAttribute)gstPluginEClass.getEStructuralFeatures().get(4);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstPlugin_Package() {
		return (EAttribute)gstPluginEClass.getEStructuralFeatures().get(5);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstPlugin_Origin() {
		return (EAttribute)gstPluginEClass.getEStructuralFeatures().get(6);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstPlugin_Loaded() {
		return (EAttribute)gstPluginEClass.getEStructuralFeatures().get(7);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getGstElement() {
		return gstElementEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getGstElement_Plugin() {
		return (EReference)gstElementEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstElement_Author() {
		return (EAttribute)gstElementEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstElement_LongName() {
		return (EAttribute)gstElementEClass.getEStructuralFeatures().get(2);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstElement_GlibClass() {
		return (EAttribute)gstElementEClass.getEStructuralFeatures().get(3);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstElement_Factory() {
		return (EAttribute)gstElementEClass.getEStructuralFeatures().get(4);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getGstObject() {
		return gstObjectEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstObject_Name() {
		return (EAttribute)gstObjectEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EAttribute getGstObject_Description() {
		return (EAttribute)gstObjectEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RegistryFactory getRegistryFactory() {
		return (RegistryFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		gstRegistryEClass = createEClass(GST_REGISTRY);
		createEReference(gstRegistryEClass, GST_REGISTRY__PLUGINS);
		createEReference(gstRegistryEClass, GST_REGISTRY__TARGET);

		gstPluginEClass = createEClass(GST_PLUGIN);
		createEReference(gstPluginEClass, GST_PLUGIN__ELEMENTS);
		createEAttribute(gstPluginEClass, GST_PLUGIN__FILENAME);
		createEAttribute(gstPluginEClass, GST_PLUGIN__VERSION);
		createEAttribute(gstPluginEClass, GST_PLUGIN__LICENSE);
		createEAttribute(gstPluginEClass, GST_PLUGIN__SOURCE);
		createEAttribute(gstPluginEClass, GST_PLUGIN__PACKAGE);
		createEAttribute(gstPluginEClass, GST_PLUGIN__ORIGIN);
		createEAttribute(gstPluginEClass, GST_PLUGIN__LOADED);

		gstElementEClass = createEClass(GST_ELEMENT);
		createEReference(gstElementEClass, GST_ELEMENT__PLUGIN);
		createEAttribute(gstElementEClass, GST_ELEMENT__AUTHOR);
		createEAttribute(gstElementEClass, GST_ELEMENT__LONG_NAME);
		createEAttribute(gstElementEClass, GST_ELEMENT__GLIB_CLASS);
		createEAttribute(gstElementEClass, GST_ELEMENT__FACTORY);

		gstObjectEClass = createEClass(GST_OBJECT);
		createEAttribute(gstObjectEClass, GST_OBJECT__NAME);
		createEAttribute(gstObjectEClass, GST_OBJECT__DESCRIPTION);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		TargetPackage theTargetPackage = (TargetPackage)EPackage.Registry.INSTANCE.getEPackage(TargetPackage.eNS_URI);
		GstreamerPackage theGstreamerPackage = (GstreamerPackage)EPackage.Registry.INSTANCE.getEPackage(GstreamerPackage.eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes
		gstPluginEClass.getESuperTypes().add(this.getGstObject());
		gstElementEClass.getESuperTypes().add(this.getGstObject());

		// Initialize classes and features; add operations and parameters
		initEClass(gstRegistryEClass, GstRegistry.class, "GstRegistry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getGstRegistry_Plugins(), this.getGstPlugin(), null, "plugins", null, 0, -1, GstRegistry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getGstRegistry_Target(), theTargetPackage.getGstTarget(), null, "target", null, 1, 1, GstRegistry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(gstPluginEClass, GstPlugin.class, "GstPlugin", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getGstPlugin_Elements(), this.getGstElement(), this.getGstElement_Plugin(), "elements", null, 1, -1, GstPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstPlugin_Filename(), ecorePackage.getEString(), "filename", null, 0, 1, GstPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstPlugin_Version(), ecorePackage.getEString(), "version", null, 0, 1, GstPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstPlugin_License(), ecorePackage.getEString(), "license", null, 0, 1, GstPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstPlugin_Source(), ecorePackage.getEString(), "source", null, 0, 1, GstPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstPlugin_Package(), ecorePackage.getEString(), "package", null, 0, 1, GstPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstPlugin_Origin(), ecorePackage.getEString(), "origin", null, 0, 1, GstPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstPlugin_Loaded(), ecorePackage.getEBoolean(), "loaded", null, 0, 1, GstPlugin.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(gstElementEClass, GstElement.class, "GstElement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getGstElement_Plugin(), this.getGstPlugin(), this.getGstPlugin_Elements(), "plugin", null, 0, 1, GstElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstElement_Author(), ecorePackage.getEString(), "author", null, 0, 1, GstElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstElement_LongName(), ecorePackage.getEString(), "longName", null, 0, 1, GstElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstElement_GlibClass(), ecorePackage.getEString(), "glibClass", null, 0, 1, GstElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstElement_Factory(), theGstreamerPackage.getElementFactory(), "factory", null, 1, 1, GstElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(gstObjectEClass, GstObject.class, "GstObject", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEAttribute(getGstObject_Name(), ecorePackage.getEString(), "name", null, 1, 1, GstObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEAttribute(getGstObject_Description(), ecorePackage.getEString(), "description", null, 1, 1, GstObject.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
	}

} //RegistryPackageImpl
